package com.itheima.config;

import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.mapper.MapperScannerConfigurer;

import javax.sql.DataSource;

/**
 * @author げっしょく
 * @date 2021/9/12
 */
public class MybatisConfig {

    public SqlSessionFactoryBean sqlSessionFactoryBean(DataSource dataSource) {
        SqlSessionFactoryBean sql = new SqlSessionFactoryBean();

        sql.setTypeAliasesPackage("com.itheima");

        sql.setDataSource(dataSource);

        return sql;
    }

    public MapperScannerConfigurer mapperScannerConfigurer() {
        MapperScannerConfigurer msc = new MapperScannerConfigurer();
        msc.setBasePackage("con.itheima.dao");
        return null;
    }
}
